home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / ae / code / ax3.00 / asl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-03  |  2.9 KB  |  104 lines

  1. #include <workbench/startup.h>
  2. #include <libraries/asl.h>
  3. #include <clib/asl_protos.h>
  4. #include <clib/exec_protos.h>
  5. #include <clib/intuition_protos.h>
  6. #include "bbs.h"
  7. extern int rzmsg;
  8. int asl(char *s)
  9. {
  10.    struct FileRequester *fr;
  11.    struct WBArg *frargs;
  12.    char src[100];
  13.    
  14.    int x;
  15.    fr=(struct FileRequester *)AllocAslRequestTags(ASL_FileRequest,
  16.        ASL_Window, MYwindow, 
  17.        ASL_Hail,(ULONG)"/X FileRequest",
  18.        ASL_Pattern,(ULONG)"#?",
  19.        ASL_FuncFlags, FILF_MULTISELECT|FILF_PATGAD,
  20.        ASL_Dir,(ULONG)&(Cmds->BBSLoc),
  21.        TAG_DONE);
  22.  
  23.    if(AslRequest(fr,0L))
  24.    {
  25.   /*      if(fr->rf_NumArgs)
  26.         {
  27.          frargs=fr->rf_ArgList;
  28.   
  29.           for(x=0;x<fr->rf_NumArgs;x++){
  30.             sprintf(temp,"Argument %d: PATH=%s FILE=%s",
  31.                x,fr->rf_Dir,frargs[x].wa_Name);sm(temp,1); }
  32.         }
  33.         else {*/
  34.          strcpy(src,fr->rf_Dir);
  35.          if(src[strlen(src)-1]!=':') sprintf(src,"%s/%s",fr->rf_Dir,fr->rf_File);
  36.          else sprintf(src,"%s%s",fr->rf_Dir,fr->rf_File);
  37.          strcpy(s,src);
  38.          //}
  39.     }
  40.     FreeAslRequest(fr);
  41. }
  42.  
  43. int batchasl(char *where)
  44. {
  45.    struct FileRequester *fr;
  46.    struct WBArg *frargs;
  47.    char src[102];
  48.    char dest[102];
  49.    int x;
  50.    int returnval;
  51.    fr=(struct FileRequester *)AllocAslRequestTags(ASL_FileRequest,
  52.        ASL_Window, MYwindow, 
  53.        ASL_Hail,(ULONG)"/X Local Upload FileRequest",
  54.        ASL_Pattern,(ULONG)"#?",
  55.        ASL_FuncFlags, FILF_MULTISELECT|FILF_PATGAD,
  56.        ASL_Dir,(ULONG)&(Cmds->BBSLoc),
  57.        TAG_DONE);
  58.    returnval=0;
  59.    AEPutStr("\r\nBatch Local upload in progress, Please Standy!\r\n");
  60.    if(AslRequest(fr,0L))
  61.    {
  62.  
  63.         returnval=(fr->rf_NumArgs)+1;
  64.         AEPutStr("\r\n");
  65.         if(fr->rf_NumArgs)
  66.         {
  67.          frargs=fr->rf_ArgList;
  68.   
  69.           for(x=0;x<fr->rf_NumArgs;x++){
  70.             strcpy(src,fr->rf_Dir); AddPart(src,frargs[x].wa_Name,100L);
  71.             strcpy(dest,where);
  72.             AddPart(dest,frargs[x].wa_Name,100L);
  73.             if(!rzmsg && Check_For_File(frargs[x].wa_Name))
  74.             {
  75.               AEPutStr("File "); AEPutStr(frargs[x].wa_Name); AEPutStr(" already exists\r\n");
  76.             }else
  77.             {
  78.             AEPutStr("Copying ");
  79.             AEPutStr(frargs[x].wa_Name); AEPutStr("\r\n");
  80.             FileCopy(src,dest);
  81.             }
  82.           }
  83.         }
  84.         else {
  85.           strcpy(src,fr->rf_Dir); AddPart(src,fr->rf_File,100L);
  86.             strcpy(dest,where);
  87.             AddPart(dest,fr->rf_File,100L);
  88.             if(!rzmsg && Check_For_File(fr->rf_File))
  89.             {
  90.               AEPutStr("File "); AEPutStr(fr->rf_File); AEPutStr(" already exists\r\n");
  91.             }else
  92.             {
  93.               AEPutStr("Copying ");
  94.               AEPutStr("\r\n");
  95.               AEPutStr(fr->rf_File);
  96.               FileCopy(src,dest);
  97.             }
  98.           }
  99.     }
  100.     FreeAslRequest(fr);
  101.     return(returnval);
  102. }
  103.  
  104.